package com.lambada;

import java.util.ArrayList;

/**
 * @author Zhang Zhe
 * @since 2019年09月04日 12:51:00
 */
public class LambdaTest {

	public static void main(String[] args) {
		ArrayList<Student> list = new ArrayList<Student>();
		list.add(new Student("zhang1","1") );
		list.add(new Student("zhang2","2") );
		list.add(new Student("zhang3","3") );
		list.add(new Student("zhang4","4") );
		list.forEach(student-> {
			student.setAge("0");
			student.setName("test");
		});
		list.forEach(student -> System.out.println(student.getAge()+"  :  "+student.getName()));
	}
}
class  Student{

	public Student(String name, String age) {
		this.name = name;
		this.age = age;
	}

	String name;

	String age;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAge() {
		return age;
	}

	public void setAge(String age) {
		this.age = age;
	}

}
